package service.impl;

import bean.Order;
import dao.OrderDao;
import dao.OrderItemDao;
import dao.impl.OrderDaoImpl;
import service.OrderService;

import java.util.List;

public class OrderServiceImpl implements OrderService {
    private OrderDao orderDao = new OrderDaoImpl();
    @Override
    public int addOrder(Order order) {
        return orderDao.addOrder(order);
    }

    @Override
    public boolean deleteOrder(int orderId) {
        return orderDao.deleteOrder(orderId);
    }

    @Override
    public List<Order> getOrderListByUserId(int UserId) {
        return orderDao.getOrderListByUserId(UserId);
    }

    @Override
    public List<Order> getOrderListByScreeningScheduleId(int ScreeningScheduleId) {
        return orderDao.getOrderListByScreeningScheduleId(ScreeningScheduleId);
    }

    @Override
    public boolean isSeatSold(int screeningScheduleId, String seat) {
        return orderDao.isSeatSold(screeningScheduleId,seat);
    }

    @Override
    public Order getOrderById(int orderId) {
       return orderDao.getOrderById(orderId);
    }
}
